Skip to content

Enforce server-side account roles and patient access - #1

Merged
arvindkumar-ship-it merged 1 commit into
mainfrom
fix/internship-audit-20261010
Oct 10, 2026
Merged

arvindkumar-ship-it merged 1 commit into
mainfrom
fix/internship-audit-20261010

Conversation

@arvindkumar-ship-it

Copy link
Copy Markdown
Owner

Added server-issued JWT sessions, bcrypt account verification, doctor/nurse roles and patient-to-record binding. Browser-supplied roles/password constants no longer authorize access. Patient reads are scoped to the configured identity, and clinical writes/audits require the appropriate role. Groq calls are awaited; missing configuration does not create a fabricated successful report. Tracked environment and bytecode files were removed and safe environment examples added.

Corrected setup paths to the active frontend/ app.

Validation

8 access-control tests passed; npm ci and Next frontend build passed. Live Mongo/provider and clinical validation were not executed.

Patch checksum and current main/base revision match were verified. The staged diff passed git diff --check; changed Python files parsed successfully.

Remaining work

Backend: copy backend/.env.example into backend/.env; use CAREFLOW_JWT_SECRET with 32+ random characters and CAREFLOW_USERS_JSON containing username, password_hash, role and patient_id for patient accounts. Generate bcrypt hashes offline (never store plaintext passwords). Start backend from its directory with uvicorn main:app; the active frontend is frontend/, not the historical backend/frontend scaffold. Frontend uses NEXT_PUBLIC_API_URL. Seed patients only with SEED_SYNTHETIC_PATIENTS=true. Previously committed credentials remain in Git history: rotate them before reuse. Real Mongo/provider integration, clinical output validation and medical accuracy remain unverified. This is a synthetic-data prototype, not a validated clinical system.

This PR proposes the reviewed repair bundle on an isolated branch. No merge, deployment, live posting or payment action is included.

@arvindkumar-ship-it
arvindkumar-ship-it merged commit 2a240b8 into main Oct 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant